Pro 7808 image widget upload (#5009) - #5021
Conversation
* configs image-widget to use AposImageWidget * Create and use AposMediaUploaderUi * removes unused methods in media manager uploader * en translations * style during dragging * wraps AposWidget shared logic to be reused in mixin and composable without too much duplication * allow update from media manager, validates image against minSize before to upload * adds up to size limit to image drag zone * adds max size option and translation in quick upload drag and drop --------- Co-authored-by: Stuart Romanek <stuart@apostrophecms.com>
* Supports placeholder with new UI * Forces option placeholder to be true to avoid unexpected bugs, user still can disable it (handed internally) * Drag and drop style with placeholder * Remove label and better handling of all events in image uploader UI
12a471c to
ed66b31
Compare
e14b312 to
d24936a
Compare
* adds missing translations for quick upload UI * disables warning for v-html
| console.warn(`No ${moduleName} module found for widget type ${this.widget.type}`); | ||
| } | ||
| return module.label; | ||
| return mod.label; |
There was a problem hiding this comment.
should avoid using reserved words.
There was a problem hiding this comment.
It's not a reserved word. Has significance in nodejs, but that doesn't stop us from using it in local functions that don't need access to module, and this isn't node.js.
No biggie though!
| } | ||
| event.preventDefault(); | ||
| this.dragging = true; | ||
| }, |
boutell
left a comment
There was a problem hiding this comment.
I really like the way you made widgets friendly to the composition API without duplicating code between that and legacy components that use the options API.
| console.warn(`No ${moduleName} module found for widget type ${this.widget.type}`); | ||
| } | ||
| return module.label; | ||
| return mod.label; |
There was a problem hiding this comment.
It's not a reserved word. Has significance in nodejs, but that doesn't stop us from using it in local functions that don't need access to module, and this isn't node.js.
No biggie though!
| import { isEqual } from 'lodash'; | ||
| import props from '../composables/AposWidgetProps.js'; | ||
| import { | ||
| _renderContent, _emitWidgetRendered, _getClasses |
There was a problem hiding this comment.
... The underscores are here to avoid naming conflicts in useAposWidget. OK.
There was a problem hiding this comment.
Yes. I thought it was clear to have a separation between logic functions and component functions that use the logic functions.
Summary
Feature quick image upload
What are the specific steps to test this change?
See designs.
Cypress 🟢
What kind of change does this PR introduce?
New image widget with quick image upload.
Make sure the PR fulfills these requirements:
If adding a new feature without an already open issue, it's best to open a feature request issue first and wait for approval before working on it.
Other information: